package com.atguigu.b_visit;

public class Demo {
    //非静态成员变量
    int num = 100;//2000

    //静态成员变量
    static int staticNum = 200; //1990


    //非静态成员方法
    public void method(){//2000
        System.out.println("非静态成员方法");
    }

    //静态成员方法
    public static void staticMethod(){//1990
        System.out.println("静态成员方法");
    }


    public static void staticFunction(){//1990
        //System.out.println("num = " + num);
        System.out.println("staticNum = " + staticNum);
        //method();
        staticMethod();

        //创建对象使用对象去调用非静态成员
        Demo demo = new Demo();
        System.out.println("demo.num = " + demo.num);
        demo.method();

        //this : 当前对象的引用
//        System.out.println("this.num = " + this.num);
//        this.method();
    }

    public void function(){//2000
        System.out.println("num = " + num);
        System.out.println("staticNum = " + staticNum);
        method();
        staticMethod();
    }
}
